/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package peticionweb.logica.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author icardenas
 */
@Embeddable
public class Cupar1aPK implements Serializable {
    @Basic(optional = false)
    @Column(nullable = false)
    private int codca;
    @Basic(optional = false)
    @Column(nullable = false, length = 4)
    private String ideye;
    @Basic(optional = false)
    @Column(nullable = false, length = 10)
    private String cidpe;

    public Cupar1aPK() {
    }

    public Cupar1aPK(int codca, String ideye, String cidpe) {
        this.codca = codca;
        this.ideye = ideye;
        this.cidpe = cidpe;
    }

    public int getCodca() {
        return codca;
    }

    public void setCodca(int codca) {
        this.codca = codca;
    }

    public String getIdeye() {
        return ideye;
    }

    public void setIdeye(String ideye) {
        this.ideye = ideye;
    }

    public String getCidpe() {
        return cidpe;
    }

    public void setCidpe(String cidpe) {
        this.cidpe = cidpe;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) codca;
        hash += (ideye != null ? ideye.hashCode() : 0);
        hash += (cidpe != null ? cidpe.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cupar1aPK)) {
            return false;
        }
        Cupar1aPK other = (Cupar1aPK) object;
        if (this.codca != other.codca) {
            return false;
        }
        if ((this.ideye == null && other.ideye != null) || (this.ideye != null && !this.ideye.equals(other.ideye))) {
            return false;
        }
        if ((this.cidpe == null && other.cidpe != null) || (this.cidpe != null && !this.cidpe.equals(other.cidpe))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "peticionweb.logica.entidad.Cupar1aPK[ codca=" + codca + ", ideye=" + ideye + ", cidpe=" + cidpe + " ]";
    }
    
}
